﻿using System;
using System.ComponentModel;
using System.Runtime.Serialization;
using Sharp.Infrastructure.Interfaces;

namespace Sharp.DataTransferObject
{
    /// <summary>
    /// 快捷登录用的OAuthConfig
    /// </summary>
    [DataContract]
    public class OAuthConfigDTO : IDTO
    {
        [DataMember]
        public Guid Id { get; set; }

        /// <summary>
        /// 接口
        /// </summary>
        [DataMember]
        public OAuthType Interface { get; set; }
        [DataMember]
        public string AppId { get; set; }
        [DataMember]
        public string AppSecret { get; set; }

        /// <summary>
        /// 第三方登录成功后回传的地址
        /// </summary>
        [DataMember]
        public string ReturnUrl { get; set; }

        /// <summary>
        /// 可用
        /// </summary>
        [DataMember]
        public bool IsEnable { get; set; }

        public string Name { get; set; }

        [DataContract]
        public enum OAuthType
        {
            [EnumMember]
            None = 0,
            /// <summary>
            /// QQ
            /// </summary>
            [Description("QQ"), EnumMember]
            QQ = 1,

            /// <summary>
            /// 微信
            /// </summary>
            [Description("微信"), EnumMember]
            Wechat = 2,

            /// <summary>
            /// 微博
            /// </summary>
            [Description("微博"), EnumMember]
            Weibo = 3,
            /// <summary>
            /// 百度
            /// </summary>
            [Description("百度"), EnumMember]
            Baidu = 4,
            /// <summary>
            /// 大平台
            /// </summary>
            [Description("大平台"), EnumMember]
            Platform = 5
        }
    }
}